<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="/static/admin/css/login.css?v20180611003" />
    <script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin.js"></script>
    <title>找回密码</title>
</head>

<body class="login">
    <div class="login_m">
        <div class="login_logo">
            <p class="getpwd_title">
                找回密码
            </p>
        </div>
        <div class="login_boder">
            <div class="login_padding" id="login_model">
                <form id="email_form" action="" method="POST">
                    <div class="email box">
                        <div class="username">
                            <h2>输入用户邮箱</h2>
                            <label>
                                <input type="text" id="email" name="email" class="txt_input" placeholder="请输入您的邮箱">
                            </label>
                            <span class="espan"></span>
                        </div>
                        <div class="verify">
                            <h2>输入验证码 </h2>
                            <label>
                                <input type="text" id="email_verify" name="verify" class="verify_input" placeholder="请输入验证码">
                                <img src="{:captcha_src()}" class="verify_img" width="120px" height="40px" onclick="this.src='{:captcha_src()}?tmp='+Math.random()">
                            </label>
                            <label>
                                <span class="vspan"></span>
                            </label>
                        </div>
                        <div class="button">
                            <label>
                                <input type="button" class="pev_button" value="上一步" onclick="window.location.href='forgot';">
                            </label>
                            <label>
                                <input type="button" class="send_button" id="email_button" value="发送验证码">
                            </label>
                        </div>
                    </div>
                </form>
            </div>
            <!--login_padding  Sign up end-->
        </div>
        <!--login_boder end-->
        <div class="copyrights"> Collect from
            <a href="javascript:void(0);"> {$Think.config.admin_email} </a>
        </div>
    </div>
    <!--login_m end-->

    <script type="text/javascript">
        $(function () {
            $('#button').css('opacity', 0.7).hover(function () {
                $(this).stop().fadeTo(650, 1);
            }, function () {
                $(this).stop().fadeTo(650, 0.7);
            });

            $("#email_button").click(function () {
                var email = $("#email").val();
                var verify = $("#email_verify").val();
                if (!checkEmpty(email, '.uspan', '* 邮箱不能为空')) return false;

                if (!checkEmpty(verify, '.vspan', '* 验证不能为空')) return false;

                $.post('sendEmail', {
                    'email': email,
                    'verify': verify
                }, function (data) {
                    if (data.code == 2) {
                        window.location.href="resetpwd";
                    } else {
                        $("#email_verify").attr('src', "{:captcha_src()}?tmp='+Math.random()");
                        $(".vspan").html(data.msg);
                        return false;
                    }
                }, 'json');
            });
        });
    </script>
</body>

</html>